import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralApparchLevel = (params) => {
  params.head.transCode = 'queryGeneralApparchLevel';
  return request({
    url: '/general/generalApparchLevel/queryGeneralApparchLevel',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralApparchLevelListPage = (params) => {
  params.head.transCode = 'queryGeneralApparchLevelListPage';
  return request({
    url: '/general/generalApparchLevel/queryGeneralApparchLevelListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralApparchLevel = (params) => {
  params.head.transCode = 'saveGeneralApparchLevel';
  return request({
    url: '/general/generalApparchLevel/saveGeneralApparchLevel',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralApparchLevelList = (params) => {
  params.head.transCode = 'saveGeneralApparchLevelList';
  return request({
    url: '/general/generalApparchLevel/saveGeneralApparchLevelList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralApparchLevel = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralApparchLevel';
  return request({
    url: '/general/generalApparchLevel/saveOrUpdateGeneralApparchLevel',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralApparchLevelList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralApparchLevelList';
  return request({
    url: '/general/generalApparchLevel/saveOrUpdateGeneralApparchLevelList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralApparchLevel = (params) => {
  params.head.transCode = 'updateGeneralApparchLevel';
  return request({
    url: '/general/generalApparchLevel/updateGeneralApparchLevel',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralApparchLevel = (params) => {
  params.head.transCode = 'deleteGeneralApparchLevel';
  return request({
    url: '/general/generalApparchLevel/deleteGeneralApparchLevel',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralApparchLevelList = (params) => {
  params.head.transCode = 'deleteGeneralApparchLevelList';
  return request({
    url: '/general/generalApparchLevel/deleteGeneralApparchLevelList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralApparchLevelExcel = (params) => {
  downloadExcel({
    url: '/general/generalApparchLevel/excelDownload/exportGeneralApparchLevelExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
